<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #upload {
            width: 180px;
            line-height: 80px;
            border-radius: 8px;
            outline: 0;
            border:0;
            background-color: rgb(69, 146, 123);
            color: #fff;
            font-size: 30px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    头像：<input type="file" id="file" style="display:none;"> <button id="upload">Upload</button>
</body>
<script>
    let uploadEle = document.getElementById("upload");
    let fileEle = document.getElementById("file");
    uploadEle.onclick = function(){
        fileEle.click();
    }

</script>
</html>